<!DOCTYPE html>
<html>
	<head></head>
	<body>
		<p>点击按钮就可以执行<em>displayDate()</em>函数</p>
		<button id="myBtn">点击这里</button>
		<script type="text/javascript">
		document.getElementById("myBtn").onclick=function(){displayDate()}
		function displayDate()
		{
			document.getElementById("demo").innerHTML=Date();			
		}
		</script>
		<p id="demo"></p>
	</body>
</html>